﻿package mortal.game.view.shop
{
    import com.greensock.*;
    import com.greensock.easing.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.common.global.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;

    public class TipsBuyItemWin extends BuyItemWin
    {
        private var _showTween:TweenMax;
        private static var _instance:TipsBuyItemWin;

        public function TipsBuyItemWin()
        {
            return;
        }// end function

        override public function show(param1:int = 0, param2:int = 0) : void
        {
            super.show(param1, param2);
            this.scaleX = 0.5;
            this.scaleY = 0.5;
            if (this._showTween != null)
            {
                this._showTween.kill();
            }
            this._showTween = TweenMax.to(this, 0.5, {scaleX:1, scaleY:1, ease:Back.easeOut});
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this.pushUIToDisposeVec(UIFactory.gTextField(Language.getString(35543), 75, 141, 150, 20, this, GlobalStyle.textFormatLv));
            return;
        }// end function

        override protected function clickHandler(event:MouseEvent) : void
        {
            var _loc_2:int = 0;
            if (event.target == _btnBuy)
            {
                _loc_2 = _numInput.value;
                _shopItem.shopItemData.num = _loc_2;
                _shopItem.shopItemData.npcId = _npcId;
                _shopItem.shopItemData.type = _shopItem.shopItemData.tShopSell.isBindMoney;
                Dispatcher.dispatchEvent(new DataEvent(EventName.BuyItem, _shopItem));
            }
            return;
        }// end function

        public static function get isViewShow() : Boolean
        {
            return _instance && !_instance.isHide;
        }// end function

        public static function get instance() : TipsBuyItemWin
        {
            if (_instance == null)
            {
                _instance = new TipsBuyItemWin;
            }
            return _instance;
        }// end function

    }
}
